<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Query Language</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="docs.css">
</head>

<body>
<!--!bodystart-->
[<a href="configure_retrieval.html">Previous: Configuring Retrieval</a>] [<a href="index.html">Contents</a>] [<a href="evaluation.html">Next: Evaluation of Experiments</a>]
<table width="100%">
  <tr> 
    <td width="82%" valign="bottom"><h1>Query Language</h1></td>
	<!--!bodyremove-->
    <td width="18%"><a href="http://ir.dcs.gla.ac.uk/terrier/"><img src="images/terrier-logo-web.jpg" border="0"></a></td>
	<!--!/bodyremove-->
  </tr>
</table>
<p align="justify">Terrier offers a flexible and powerful query language for searching with
phrases, fields, or specifying that terms are required to appear in the 
retrieved documents. Some examples of queries are the following:</p>
<table border="1">
<tr><td>term1 term2 </td><td>retrieves documents that contains 1 or more 
                             term1 and term2 (they need not contain both)</td></tr>
<tr><td>term1^2.3</td><td>the weight of term1 is boosted 2.3.</td></tr>
<tr><td>+term1 +term2</td><td>retrieves documents that contain both term1 
                             and term2.</td></tr>
<tr><td>+term1 -term2</td><td>retrieves documents that contain term1 and
                             do not contain term2.</td></tr>
<tr><td>&quot;term1 term2&quot;</td><td>retrieves documents where the terms term1
                             and term2 appear in a phrase.</td></tr>
<tr><td>&quot;term1 term2&quot;~n</td><td>retrieves documents where the terms term1
                             and term2 appear within a distance of n
                             blocks. The order of the terms is not
                             considered.</td></tr>
</table>  

<p align="justify">Combinations of the different constructs are possible as well. For 
example, the query <tt>term1 term2 -&quot;term1 term2&quot;</tt> would retrieve all the documents that contain at least one of the terms
term1 and term2, but not the documents where the phrase &quot;term1 term2&quot; appears.</p>

[<a href="configure_retrieval.html">Previous: Configuring Retrieval</a>] [<a href="index.html">Contents</a>] [<a href="evaluation.html">Next: Evaluation of Experiments</a>]
<!--!bodyend-->
<hr>
<small>
Webpage: <a href="http://ir.dcs.gla.ac.uk/terrier">http://ir.dcs.gla.ac.uk/terrier</a><br>
Contact: <a href="mailto:terrier@dcs.gla.ac.uk">terrier@dcs.gla.ac.uk</a><br>
<a href="http://www.dcs.gla.ac.uk/">Department of Computing Science</a><br>

Copyright (C) 2004-2008 <a href="http://www.gla.ac.uk/">University of Glasgow</a>. All Rights Reserved.
</small>
</body>
</html>
